< previous page page_216 next page >

Page 216
Chapter Objectives
Learn the uses of dialog boxes
Learn the difference between modal and nonmodal operations
Learn to use the MsgBox function
Learn to use the InputBox function
Learn about the common dialog control
Learn to build your own About box
Sample Project File: \Chapter11\Dialogs.vbp
Uses of Dialog Boxes
Dialog boxes have two major uses: displaying information to the user and retrieving data from the user. You use dialog boxes almost anytime you use a Windows application. Examples of dialog boxes are the File Open, File Save, and About dialog boxes in typical Windows applications such as Microsoft Word and Microsoft Excel. The File Open and File Save dialog boxes are used to enable the user to open a file and save a file, respectively. These dialog boxes must be completed prior to continuing with the program. The About box is used to convey information to the user. In Visual Basic, the form you use to set project properties is also a dialog box.
Modal Versus Nonmodal
Dialog boxes can be one of two types: modal or nonmodal (modeless). Modal dialog boxes are used when you need the user to respond to some prompt or message before continuing with the program. The user is not able to shift focus to another part of the application until the question is answered and the dialog box is closed. The user may still task-switch to another application running in the Windows environment, he or she just cant do anything in the application in which the modal dialog box is opened.
Youve already used a couple different modal dialog boxes in this book. The InputBox and MsgBox functions are modal. Both of these dialog boxes require the user to respond prior to continuing with the program. These modal dialog boxes are referred to as application modal, because only the current application is frozen. System modal dialog boxes are possible in Windows, but theyre hardly ever used.

 
< previous page page_216 next page >

If you like this book, buy it!